home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / comm / htmst608.zip / HTMSTRIP.DOC < prev    next >
Text File  |  1996-08-31  |  21KB  |  414 lines

  1. HTMSTRIP.DOC                         1                         Revised: 08-31-96
  2.  
  3. The HTMSTRIP.EXE program attempts to read HTML pages, remove  the  HTML  coding,
  4. and write the file out as something more useful.  Features of this program:
  5.  
  6.   * Can be run across an entire subdirectory (for example, your entire
  7.     cache subdirectory), and will only process the HTML documents that it finds.
  8.     (There are some options on this.)
  9.   * Removes all imbedded HTML commands.
  10.   * Recodes the standard HTML "entity references" (e.g. "©" becomes
  11.     "(c)").  The actual replacements are coded in a user-modifiable lookup file.
  12.   * Handles standard indent, heading, selection groups, menus, tables, etc.
  13.   * Reflows all text as appropriate
  14.   * Optionally, will replace Link, Image, and Input references with
  15.     user-definable text representations.
  16.   * Optionally, alerts you to possible errors in the HTML code itself.
  17.  
  18. HTML codes are surrounded within <...>  indicators.   For  upward  compatibility
  19. reasons, Web browsers ignore any codes  that  they  don't  understand  and  just
  20. process the ones they can handle.
  21.  
  22. Note that the HTMSTRIP command is currently geared for handling HTML  2.0  files
  23. and then Netscape table-specific extensions (added to HTML 3.0).
  24.  
  25. HTMSTRIP removes all HTML codes.  It also  handles  the  standard  HTML  "&xxx;"
  26. "entity references" (e.g. "©" is replaced by "(c)").  You can add or change
  27. these replacements as desired by using the INI file (documented later).
  28.  
  29. HTMSTRIP is also tuned to allow it to  specially-handle  several  embedded  HTML
  30. codes.  These codes are the following:
  31.  
  32.        <A ...>                       External link
  33.        <BLOCKQUOTE>...</BLOCKQUOTE>  Indented block of text
  34.        <BR>                          Forced line break
  35.        <CAPTION>...</CAPTION>        Title for a table
  36.        <CENTER>...</CENTER>          Centering text
  37.        <DD>                          Term definition
  38.        <DIR>...</DIR>                Directory list of items
  39.        </DL>                         End of definition list
  40.        <DT>                          First term of definition list/glossary
  41.        <H1> to <H6>...</H1> to </H6> Heading items
  42.        <HR>                          Horizontal rule
  43.        <IMG ...>                     Image
  44.        <INPUT ...>                   User input
  45.        <LI>                          Menu/Ordered/Unordered/Directory list item
  46.        <MENU>...</MENU>              Menu listing
  47.        <OL>...</OL>                  Ordered listing
  48.        <OPTION>                      Used for single/multiple choice menus
  49.        <P>                           Paragraph indicator
  50.        <PRE>...</PRE>                Preserve spacing block (preformatted text)
  51.        <SCRIPT>...</SCRIPT>          Java script blocks are ignored
  52.        <SELECT>...</SELECT>          Block for single/multiple choice menu
  53.        <TABLE>...</TABLE>            Table block
  54.        <TD>...</TD>                  Table data (cell)
  55.        <TH>...</TH>                  Table heading
  56.        <TITLE>...</TITLE>            Title item
  57.        <TR>...</TR>                  Table row
  58.        <UL>...</UL>                  Unordered listing
  59.  
  60. HTMSTRIP.DOC                         2                         Revised: 08-31-96
  61.  
  62. If you run across other codes that become vital, let me know  and  I'll  try  to
  63. handle them somehow.
  64.  
  65.  
  66. How to get HTML files:
  67.  
  68. Some people who are using regular Web browsers like  Mosaic  or  Netscape  don't
  69. realize that  they're  automatically  saving  HTML  files  to  their  hard  disk
  70. throughout every Web session.  That's because just about every Web browser saves
  71. the most-recently accessed files from  the  Web  (including  HTML  source  code,
  72. GIF's, and JPG's) on your hard  disk  and  reads  them  from  there  instead  of
  73. requiring you to download them every time you go back to a previous page.   This
  74. is typically settable by  you  under  "Preferences"  and  "Cache"  on  your  Web
  75. browser.
  76.  
  77. I usually set my Web browser to have a huge cache, maybe 10MB.   Anything  beats
  78. downloading the same pages over again even at 28.8K.  And I make sure that I  do
  79. not have anything specified like "clear cache at the end of every session". Then
  80. I just go through the files in the cache subdirectory  afterward  and  reprocess
  81. them.
  82.  
  83. Two disadvantages to a cache...  It takes up hard disk space but, hey,  the  Web
  84. browser  is  typically  in  Windows  so  why  are  you  surprised.   The  second
  85. disadvantage is  that  if  the  page  actually  changes  between  sessions,  you
  86. typically won't notice the new page as long as it remains in your cache.  If you
  87. think a page is still in cache and should have been changed but didn't, you  can
  88. typically ask your Web browser to reload the page.  On some  browsers,  this  is
  89. shown as an arrow in the form of a circle.
  90.  
  91. HTMSTRIP can process the entire cache subdirectory.   It  automatically  detects
  92. non-HTML files for you and processes accordingly.   It  creates  new  text  file
  93. versions of just the HTML pages it finds.
  94.  
  95. By the way, for some reason, the current  beta  version  of  Netscape  typically
  96. ignores my cache setting for some reason.  I don't have the slightest idea  why.
  97. As a result, when you Alt-F4 out of Netscape, it goes through  and  deletes  all
  98. but a few of the temporary files.  This is annoying to  say  the  least.   As  a
  99. result, I have to run HTMSTRIP from a DOS window just before  leaving  Netscape.
  100. If anyone knows why it does this to me, please let me know!
  101.  
  102.  
  103. Specifying parameters:
  104.  
  105. Parameters for this program can be set in the following ways.  The last  setting
  106. encountered always wins:
  107.   - Read from an *.INI file (see BRUCEINI.DOC file),
  108.   - Through the use of an environmental variable (SET HTMSTRIP=whatever), or
  109.   - From the command line (see "Syntax" below)
  110.  
  111.  
  112.  
  113. HTMSTRIP.DOC                         3                         Revised: 08-31-96
  114.  
  115. Defining entity references:
  116.  
  117. HTMSTRIP will process an entity reference definition file is one is found.  This
  118. table can be in your standard *.INI file (e.g. HTMSTRIP.INI) if  desired  or  it
  119. can be a separate file specified using the /Linitfile parameter.
  120.  
  121. Entity references are how non-standard characters like the  copyright  character
  122. are handled in HTML pages.  Entity references are  indicated  as  "&xxx;"  where
  123. "xxx" is either a code or a number preceded by  a  pound  sign.   The  copyright
  124. symbol is indicated in HTML as "©".
  125.  
  126. A default HTMSTRIP.INI is provided with over 230 entity reference  lookups.   To
  127. define or change these lookups, the INI file should include a series of lines in
  128. the following format:
  129.  
  130.         &xxx; = outstr
  131.  
  132. where "&xxx;" is the HTML sequence and "outstr" is what you want to  replace  it
  133. with.  The  "outstr"  portion  can  consist  of  regular  non-space  ASCII  text
  134. characters (like "A" or "z") as well as hexadecimal values (in the form &Hxx) or
  135. decimal values (in the form \nnn).  (See the BRUCEHEX.DOC file.) It can also  be
  136. the word "NULL" which translates the string into  nothing.   You  cannot  use  a
  137. space or equal sign in "outstr"; use the hexadecimal or decimal  representations
  138. instead.  The table does not have to be in any specified order.  Lines  can  end
  139. with "/*" followed by a comment if you want.  Examples:
  140.  
  141.         ©   = (c)      /* Copyright symbol
  142.         °    = °
  143.         é = é
  144.         ê  = ê
  145.         è = è
  146.             = \032
  147.  
  148. Remember  that  "&xxx;"  entity  references  (yes,  I  hate  that  phrase)   are
  149. case-sensitive in HTML.  "°" will not find "&Deg;".
  150.  
  151. There seems to be a trend of late  to  relax  some  of  the  replacement  coding
  152. requirements in Web pages.  The  ";"  is  now,  apparently,  becoming  optional.
  153. Numeric replacements (e.g. " ") seem to no longer require the leading  pound
  154. sign.   Therefore,  HTMSTRIP  looks  for  both  of  these  iterations  for   any
  155. appropriate lookup.  "©" will find "©" and "™" will  find  "&153".
  156. The lookup itself has to be entered in the formally correct way thoug